package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.Orders;
import com.foreknow.elmboot.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/OrdersController")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
    @RequestMapping("/createOrders")
    public Object createOrders(Orders orders){
        return ordersService.screateOrders(orders);
    }
    @RequestMapping("/getOrdersById")
    public Object getOrdersById(Orders orders){
        return ordersService.sgetOrdersById(orders);
    }
    @RequestMapping("/listOrdersByUserId")
    public Object listOrdersByUserId(Orders orders){
        return ordersService.slistOrdersByUserId(orders);
    }
}
